<!DOCTYPE >
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>设置权限</title>


<link rel="stylesheet" type="text/css" href="/system/css/right.css">
<script type="text/javascript" src="/system/js/jquery.js"></script>
<script type="text/javascript" src="/system/js/system.js"></script>
<script type="text/javascript" src="/system/js/admin.js"></script>
</head>
<style>
select{
	margin: 0;
}
</style>
<body style="overflow: auto;">
	<div class="basic bor">
			<div class="title fl">当前位置：前端权限管理 > 设置权限</div>
	</div>

	<form action="{:url('news/addcate')}" method="post">
	<div class="addnav">
	    	<!-- <span class="navname">搜索：</span>
		    <input class="input127" type="text" name="name">
        <input  type="hidden" name="type" value="">
        <input class="submit addnew" name="submit" type="submit" value="添加" />
 -->
		<!-- <a class="submit fr addnews" href=""  />添加业务经理</a> -->
	</div>
	</form>

<!-- 文章分类列表 -->
<div class="catelist">
    <div class="lists listsov">
    	<dd>业务经理列表 </dd>
    </div>
</div>
<!-- /文章分类列表 -->

<table border="1"  class="table table-hover text-center" id='list'>
  <tr class="trcolor">
    <!-- <td>选择</td> -->
   	<td>用户名称</td>
   	<td>用户账号</td>
    <td>手机号码</td>
    <td>编辑权限</td>
  </tr>


<!-- ============================================================= -->

{volist name='list' id='li'}
    <tr>
    	<!-- <td><input type ="checkbox" class="checkbox bor"  id = "{$li.id}" value ="{$li.id}"></td> -->
    	<td>{$li.name ?? ''}</td>
    	<td>{$li.nickname ?? '未定义'}</td>
    	<td>{$li.mobile ?? '未定义'}</td>
      <td>
      	<select id="lvshiid{$li.id}" onchange="retum_cond({$li.id})" >
						<option value="">设置权限</option>
						{volist name="role" id="vo"}
      			<option value="{$vo.id}" {if condition="$li.role_id eq $vo.id"} selected="selected" {/if}  >{$vo.name}</option>
							{/volist}

      	</select>
      </td>
    </tr>
{/volist}
<!-- ============================================================= -->
</table>
<div class="pages">
	<script type="text/javascript">
		function retum_cond(id){
				var options=$("#lvshiid"+id+" option:selected").val();
				$.ajax({
						type:"post",                      //请求类型
						url:'{:url("Homerole/upuserrole")}',           //URL
						data:{'role_id':options,'id':id},   //传递的参数
						dataType:"json",                 //返回的数据类型
						success:function(data){          //data就是返回的json类型的数据
							alert(data.ok);
						}
				});
		}

	</script>
    <div class="page_s fr">{$page??''}</div>
</div>

<!-- 提示 -->
<p class="ts"><span class="colorf00">*</span><span class="ts_text"> 如果要修排序请直接点击文字修改。</span></p>
</body>

</html>
